import sys
from PyQt5.QtWidgets import QSlider, QApplication, QVBoxLayout, QHBoxLayout, QWidget, QLabel
from PyQt5.QtCore import Qt

class SliderBasic(QWidget):
    def __init__(self):
        super().__init__()
        self.setup_ui()
    
    def setup_ui(self):
        layout = QVBoxLayout()
        
        # 水平滑块
        self.horizontal_slider = QSlider(Qt.Horizontal)
        self.horizontal_slider.setMinimum(0)
        self.horizontal_slider.setMaximum(100)
        self.horizontal_slider.setValue(50)
        
        # 垂直滑块
        self.vertical_slider = QSlider(Qt.Vertical)
        self.vertical_slider.setMinimum(0)
        self.vertical_slider.setMaximum(100)
        self.vertical_slider.setValue(25)
        
        # 布局
        h_layout = QHBoxLayout()
        h_layout.addWidget(QLabel("水平滑块:"))
        h_layout.addWidget(self.horizontal_slider)
        
        v_layout = QHBoxLayout()
        v_layout.addWidget(QLabel("垂直滑块:"))
        v_layout.addWidget(self.vertical_slider)
        
        layout.addLayout(h_layout)
        layout.addLayout(v_layout)
        self.setLayout(layout)

if __name__ == "__main__":
    app = QApplication(sys.argv)
    window = SliderBasic()
    window.show()
    sys.exit(app.exec_())